﻿<TabItem x:Class="RibbonTab"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
             xmlns:Metro="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
             mc:Ignorable="d" 
             Style="{DynamicResource InnerBackstageTabCotrolItem}" MaxWidth="300">
    <Grid>
        <TabControl Name="TabControl">
            <TabItem Header="Kunde auswählen  ">
                <Grid>
                    <TextBlock Margin="12,12,7,259" Text="Wählen Sie zunächst einen Rechnungskunden aus und wechseln sie danach zum Tab Lieferscheine" />
                </Grid>
            </TabItem>
            <TabItem Header="Lieferscheine" Name="TabItem1">
                <Grid>
                    <ListView Margin="20,15,14,50" Name="ListView4" ItemsSource="{Binding DeliveryOrders}">
                        <ListView.ItemContainerStyle>
                            <Style TargetType="ListViewItem">
                                <Setter Property="HorizontalContentAlignment" Value="Center" />
                                <Setter Property="MinHeight" Value="20px" />
                            </Style>
                        </ListView.ItemContainerStyle>
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Header="Datum" Width="{Binding ElementName=helperWidthAuftrag6, Path=ActualWidth}" DisplayMemberBinding="{Binding Date_}"/>
                                <GridViewColumn Header="Nummer" Width="{Binding ElementName=helperWidthAuftrag7, Path=ActualWidth}" DisplayMemberBinding="{Binding OrderID}" />
                                <GridViewColumn Header="Name" Width="{Binding ElementName=helperWidthAuftrag8, Path=ActualWidth}" DisplayMemberBinding="{Binding CustomerName}" />
                                <GridViewColumn Header="Warenwert" Width="{Binding ElementName=helperWidthAuftrag9, Path=ActualWidth}" DisplayMemberBinding="{Binding Value}" />
                            </GridView>
                        </ListView.View>
                    </ListView>
                    <!--GridView für die Größe-->
                    <Grid Visibility="Hidden" Width="{Binding ElementName=ListView4, Path=ActualWidth}">
                        <Grid.ColumnDefinitions>
                            <!--Width is bound to width of the first GridViewColumn -->
                            <ColumnDefinition Width="0.5*" MaxWidth="150"/>
                            <ColumnDefinition Width="0.5*" MaxWidth="150"/>
                            <ColumnDefinition Width="3*"/>
                            <ColumnDefinition Width="*" MaxWidth="150"/>
                            <ColumnDefinition Width="0.15*" MinWidth="8"/>
                        </Grid.ColumnDefinitions>
                        <Grid Grid.Column="0" x:Name="helperWidthAuftrag6"/>
                        <Grid Grid.Column="1" x:Name="helperWidthAuftrag7"/>
                        <Grid Grid.Column="2" x:Name="helperWidthAuftrag8"/>
                        <Grid Grid.Column="3" x:Name="helperWidthAuftrag9"/>
                        <Grid Grid.Column="4" x:Name="helperWidthAuftrag10"/>
                    </Grid>
                    <Button Content="Ausgewählte Lieferscheine zusammenführen" Height="23" HorizontalAlignment="Right" Margin="0,0,14,11" VerticalAlignment="Bottom" Width="269" Name="Button1" />
                </Grid>
            </TabItem>
        </TabControl>
    </Grid>
    <TabItem.Header>
        <Grid>
            <StackPanel Width="48" Margin="10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
                <Image Source="Images/sammelrechnung.png" Width="48" Height="48" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0"/>
            </StackPanel>
            <Grid Margin="68,0,0,0" Name="_grid_others">
                <StackPanel Orientation="Vertical" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="False">
                    <TextBlock Text="Sammelrechnung erstellen"/>
                    <TextBlock Text="Führen Sie mehrere Lieferscheine zu einer gesammelten Rechnung zusammen" Foreground="DimGray" TextWrapping="Wrap" />
                </StackPanel>
            </Grid>
        </Grid>
    </TabItem.Header>
    <TabItem.Resources>
        <ResourceDictionary>
            <!--Define the template for the first column to contain a CheckBox control-->
            <DataTemplate x:Key="FirstCell">
                <StackPanel Orientation="Horizontal">
                    <CheckBox IsChecked="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListViewItem}}}"/>
                </StackPanel>
            </DataTemplate>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </TabItem.Resources>
</TabItem>
